<template>
    <div class="max_div" @click="close" v-if="isShow">
        <div class="center_box">
            <span class="title_box">{{title}}</span>
            <div class="message_box">
                {{message}}
            </div>
            <div class="div_check">
                <span @click="cancel">{{cancelText}}</span>
                <span @click="confirm">{{confirmText}}</span>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    props:["title","message","confirmText","cancelText"],
    data(){
        return {
            isShow:false
        }
    },
    methods:{
        show(){
            this.isShow = true
        },
        close(){
            this.isShow = false
        },
        cancel(){
            this.isShow = false
            this.$emit("cancel")
        },
        confirm(){
            this.isShow = false
            this.$emit("confirm")
        }
    }
}
</script>
<style lang="less" scoped>
.max_div{
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, .5);
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 5000;
    .center_box{
        position: relative;
        width: 80%;
        min-height: 200px;
        background: #fff;
        border-radius: 20px;
        .title_box{
            text-align: center;
            display: inline-block;
            width: 100%;
            height: 50px;
            line-height: 50px;
            font-size: 20px;
        }
        .message_box{
            padding: 10px 30px;
            font-size: 16px;
        }
        .div_check{
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            span{
                width: 50%;
                height: 40px;
                font-size: 15px;
                display: inline-block;
                line-height: 40px;
                text-align: center;
            }
        }
    }
}

</style>